﻿using System;
using System.Windows.Data;
using Aeon.Presentation;

namespace Aeon.Emulator.Launcher
{
    internal sealed class MouseModeConverter : IValueConverter
    {
        #region IValueConverter Members
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            MouseInputMode mouseMode = (MouseInputMode)value;
            return mouseMode == MouseInputMode.Absolute;
        }
        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            if(value is bool)
                return (bool)value ? MouseInputMode.Absolute : MouseInputMode.Relative;
            else
                return MouseInputMode.Relative;
        }
        #endregion
    }
}
